package org.cancer.hadesdata.utils;

public class StringEscape {

	public static String escapeHtml(String str)
	{
		return str
				.replaceAll("/", "-fxg-")
				.replaceAll("\\[", "-zfk-")
				.replaceAll("\\]", "-yfk-")
				.replaceAll("\\.", "-dot-")
				.replaceAll(" ", "-sps-")
				.replaceAll("\\@", "-ate-");
	}
	
	public static String unescapeHtml(String str)
	{
		return str
				.replaceAll("-fxg-", "/")
				.replaceAll("-zfk-", "\\[")
				.replaceAll("-yfk-", "\\]")
				.replaceAll("-dot-", "\\.")
				.replaceAll("-sps-", " ")
				.replaceAll("-ate-", "\\@");
	}
}
